};
template<>
-struct Converter<base::debug::CategoryFilter> {
+struct Converter<base::trace_event::CategoryFilter> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
- base::debug::CategoryFilter* out) {
+ base::trace_event::CategoryFilter* out) {
std::string filter;
if (!ConvertFromV8(isolate, val, &filter))
return false;
- *out = base::debug::CategoryFilter(filter);
+ *out = base::trace_event::CategoryFilter(filter);
return true;
}
};
template<>
-struct Converter<base::debug::TraceOptions> {
+struct Converter<base::trace_event::TraceOptions> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
- base::debug::TraceOptions* out) {
+ base::trace_event::TraceOptions* out) {
std::string options;
if (!ConvertFromV8(isolate, val, &options))
return false;
return embedder_web_contents_;
}
-void WebContents::GuestSizeChanged(const gfx::Size& old_size,
- const gfx::Size& new_size) {
+void WebContents::GuestSizeChanged(const gfx::Size& new_size) {
if (!auto_size_enabled_)
return;
+ GuestSizeChangedDueToAutoSize(guest_size_, new_size);
guest_size_ = new_size;
- GuestSizeChangedDueToAutoSize(old_size, new_size);
}
void WebContents::RegisterDestructionCallback(
void DidAttach(int guest_proxy_routing_id) final;
void ElementSizeChanged(const gfx::Size& size) final;
content::WebContents* GetOwnerWebContents() const final;
- void GuestSizeChanged(const gfx::Size& old_size,
- const gfx::Size& new_size) final;
+ void GuestSizeChanged(const gfx::Size& new_size) final;
void RegisterDestructionCallback(const DestructionCallback& callback) final;
void SetGuestSizer(content::GuestSizer* guest_sizer) final;
void WillAttach(content::WebContents* embedder_web_contents,
void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* render_view_host,
- const GURL& url,
content::WebPreferences* prefs) {
prefs->javascript_enabled = true;
prefs->web_security_enabled = true;
prefs->allow_running_insecure_content = false;
// Turn off web security for devtools.
- if (url.SchemeIs("chrome-devtools")) {
+ auto web_contents = content::WebContents::FromRenderViewHost(
+ render_view_host);
+ if (web_contents && web_contents->GetURL().SchemeIs("chrome-devtools")) {
prefs->web_security_enabled = false;
return;
}
NativeWindow* window = NativeWindow::FromRenderView(
process->GetID(), render_view_host->GetRoutingID());
if (window)
- window->OverrideWebkitPrefs(url, prefs);
+ window->OverrideWebkitPrefs(prefs);
}
bool AtomBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
content::AccessTokenStore* CreateAccessTokenStore() override;
void ResourceDispatcherHostCreated() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
- const GURL& url,
content::WebPreferences* prefs) override;
bool ShouldSwapBrowsingInstancesForNavigation(
content::SiteInstance* site_instance,
}
}
-void NativeWindow::OverrideWebkitPrefs(const GURL& url,
- content::WebPreferences* prefs) {
+void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) {
if (web_preferences_.IsEmpty())
return;
// Called when renderer process is going to be started.
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id);
- void OverrideWebkitPrefs(const GURL& url, content::WebPreferences* prefs);
+ void OverrideWebkitPrefs(content::WebPreferences* prefs);
// Public API used by platform-dependent delegates and observers to send UI
// related notifications.
webview_info_map_[guest_process_id] = info;
// Map the element in embedder to guest.
- ElementInstanceKey key(embedder, element_instance_id);
+ int owner_process_id = embedder->GetRenderProcessHost()->GetID();
+ ElementInstanceKey key(owner_process_id, element_instance_id);
element_instance_id_to_guest_map_[key] = guest_instance_id;
}
}
content::WebContents* WebViewManager::GetGuestByInstanceID(
- content::WebContents* embedder,
+ int owner_process_id,
int element_instance_id) {
- ElementInstanceKey key(embedder, element_instance_id);
+ ElementInstanceKey key(owner_process_id, element_instance_id);
if (!ContainsKey(element_instance_id_to_guest_map_, key))
return nullptr;
protected:
// content::BrowserPluginGuestManager:
- content::WebContents* GetGuestByInstanceID(
- content::WebContents* embedder_web_contents,
- int element_instance_id) override;
+ content::WebContents* GetGuestByInstanceID(int owner_process_id,
+ int element_instance_id) override;
bool ForEachGuest(content::WebContents* embedder,
const GuestCallback& callback) override;
std::map<int, WebContentsWithEmbedder> web_contents_embdder_map_;
struct ElementInstanceKey {
- content::WebContents* owner_web_contents;
+ int embedder_process_id;
int element_instance_id;
- ElementInstanceKey(content::WebContents* owner_web_contents,
- int element_instance_id)
- : owner_web_contents(owner_web_contents),
+ ElementInstanceKey(int embedder_process_id, int element_instance_id)
+ : embedder_process_id(embedder_process_id),
element_instance_id(element_instance_id) {}
bool operator<(const ElementInstanceKey& other) const {
- if (owner_web_contents != other.owner_web_contents)
- return owner_web_contents < other.owner_web_contents;
+ if (embedder_process_id != other.embedder_process_id)
+ return embedder_process_id < other.embedder_process_id;
return element_instance_id < other.element_instance_id;
}
bool operator==(const ElementInstanceKey& other) const {
- return (owner_web_contents == other.owner_web_contents) &&
+ return (embedder_process_id == other.embedder_process_id) &&
(element_instance_id == other.element_instance_id);
}
};
- // (web_contents, element_instance_id) => guest_instance_id
+ // (embedder_process_id, element_instance_id) => guest_instance_id
std::map<ElementInstanceKey, int> element_instance_id_to_guest_map_;
typedef std::map<int, WebViewInfo> WebViewInfoMap;
virtual void didStopLoading();
// blink::WebFrameClient override:
- virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent,
- const blink::WebString& name);
+ virtual blink::WebFrame* createChildFrame(
+ blink::WebLocalFrame* parent,
+ const blink::WebString& name,
+ blink::WebSandboxFlags sandboxFlags);
virtual void frameDetached(blink::WebFrame* frame);
private:
blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
blink::WebLocalFrame* parent,
- const blink::WebString& name) {
+ const blink::WebString& name,
+ blink::WebSandboxFlags sandboxFlags) {
blink::WebFrame* frame = blink::WebLocalFrame::create(this);
parent->appendChild(frame);
return frame;
#include "printing/page_size_margins.h"
#include "printing/pdf_metafile_skia.h"
#include "skia/ext/platform_device.h"
-#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
#include "printing/metafile_skia_wrapper.h"
#include "printing/page_size_margins.h"
#include "skia/ext/platform_device.h"
-#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/platform/WebCanvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "printing/pdf_metafile_skia.h"
#include "printing/units.h"
#include "skia/ext/platform_device.h"
-#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"