dict.SetMethod("startRecording", base::Bind(
&TracingController::EnableRecording, base::Unretained(controller)));
dict.SetMethod("stopRecording", base::Bind(
- &TracingController::DisableRecording, base::Unretained(controller)));
+ &TracingController::DisableRecording,
+ base::Unretained(controller),
+ nullptr));
dict.SetMethod("startMonitoring", base::Bind(
&TracingController::EnableMonitoring, base::Unretained(controller)));
dict.SetMethod("stopMonitoring", base::Bind(
&TracingController::DisableMonitoring, base::Unretained(controller)));
dict.SetMethod("captureMonitoringSnapshot", base::Bind(
&TracingController::CaptureMonitoringSnapshot,
- base::Unretained(controller)));
+ base::Unretained(controller),
+ nullptr));
dict.SetMethod("getTraceBufferPercentFull", base::Bind(
&TracingController::GetTraceBufferPercentFull,
base::Unretained(controller)));
Emit("destroyed");
}
-void WebContents::WillAttach(content::WebContents* embedder_web_contents,
- const base::DictionaryValue& extra_params) {
- embedder_web_contents_ = embedder_web_contents;
- extra_params_.reset(extra_params.DeepCopy());
-}
-
-content::WebContents* WebContents::CreateNewGuestWindow(
- const content::WebContents::CreateParams& create_params) {
- NOTREACHED() << "Should not create new window from guest";
- return nullptr;
-}
-
-void WebContents::DidAttach() {
+void WebContents::DidAttach(int guest_proxy_routing_id) {
base::ListValue args;
args.Append(extra_params_.release());
Emit("did-attach", args);
}
-int WebContents::GetGuestInstanceID() const {
- return guest_instance_id_;
-}
-
void WebContents::ElementSizeChanged(const gfx::Size& old_size,
const gfx::Size& new_size) {
element_size_ = new_size;
GuestSizeChangedDueToAutoSize(old_size, new_size);
}
-void WebContents::RequestPointerLockPermission(
- bool user_gesture,
- bool last_unlocked_by_target,
- const base::Callback<void(bool enabled)>& callback) {
- callback.Run(true);
-}
-
void WebContents::RegisterDestructionCallback(
const DestructionCallback& callback) {
destruction_callback_ = callback;
}
+void WebContents::WillAttach(content::WebContents* embedder_web_contents,
+ int browser_plugin_instance_id) {
+ embedder_web_contents_ = embedder_web_contents;
+}
+
void WebContents::Destroy() {
if (storage_) {
if (!destruction_callback_.is_null())
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault);
- params.transition_type = content::PAGE_TRANSITION_TYPED;
+ params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
web_contents()->GetController().LoadURLWithParams(params);
}
virtual void WebContentsDestroyed() override;
// content::BrowserPluginGuestDelegate:
- virtual void WillAttach(content::WebContents* embedder_web_contents,
- const base::DictionaryValue& extra_params) override;
- virtual content::WebContents* CreateNewGuestWindow(
- const content::WebContents::CreateParams& create_params) override;
- virtual void DidAttach() override;
- virtual int GetGuestInstanceID() const override;
- virtual void ElementSizeChanged(const gfx::Size& old_size,
- const gfx::Size& new_size) override;
- virtual void GuestSizeChanged(const gfx::Size& old_size,
- const gfx::Size& new_size) override;
- virtual void RequestPointerLockPermission(
- bool user_gesture,
- bool last_unlocked_by_target,
- const base::Callback<void(bool enabled)>& callback) override;
- virtual void RegisterDestructionCallback(
- const DestructionCallback& callback) override;
+ void DidAttach(int guest_proxy_routing_id) final;
+ void ElementSizeChanged(const gfx::Size& old_size,
+ const gfx::Size& new_size) final;
+ void GuestSizeChanged(const gfx::Size& old_size,
+ const gfx::Size& new_size) final;
+ void RegisterDestructionCallback(const DestructionCallback& callback) final;
+ void WillAttach(content::WebContents* embedder_web_contents,
+ int browser_plugin_instance_id) final;
private:
// Called when received a message from renderer.
namespace atom {
JavascriptEnvironment::JavascriptEnvironment()
- : isolate_holder_(gin::IsolateHolder::kNonStrictMode),
- isolate_(isolate_holder_.isolate()),
+ : isolate_(isolate_holder_.isolate()),
isolate_scope_(isolate_),
locker_(isolate_),
handle_scope_(isolate_),
}
void AdapterRequestJob::Start() {
- DCHECK(!real_job_);
+ DCHECK(!real_job_.get());
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
}
void AdapterRequestJob::Kill() {
- if (real_job_) // Kill could happen when real_job_ is created.
+ if (real_job_.get()) // Kill could happen when real_job_ is created.
real_job_->Kill();
}
bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf,
int buf_size,
int *bytes_read) {
- DCHECK(real_job_);
+ DCHECK(!real_job_.get());
return real_job_->ReadRawData(buf, buf_size, bytes_read);
}
bool AdapterRequestJob::IsRedirectResponse(GURL* location,
int* http_status_code) {
- DCHECK(real_job_);
+ DCHECK(!real_job_.get());
return real_job_->IsRedirectResponse(location, http_status_code);
}
net::Filter* AdapterRequestJob::SetupFilter() const {
- DCHECK(real_job_);
+ DCHECK(!real_job_.get());
return real_job_->SetupFilter();
}
bool AdapterRequestJob::GetMimeType(std::string* mime_type) const {
- DCHECK(real_job_);
+ DCHECK(!real_job_.get());
return real_job_->GetMimeType(mime_type);
}
bool AdapterRequestJob::GetCharset(std::string* charset) {
- DCHECK(real_job_);
+ DCHECK(!real_job_.get());
return real_job_->GetCharset(charset);
}
web_contents_map_.erase(guest_instance_id);
}
-void WebViewManager::MaybeGetGuestByInstanceIDOrKill(
- int guest_instance_id,
- int embedder_render_process_id,
- const GuestByInstanceIDCallback& callback) {
+content::WebContents* WebViewManager::GetGuestByInstanceID(
+ content::WebContents* embedder_web_contents,
+ int guest_instance_id) {
if (ContainsKey(web_contents_map_, guest_instance_id))
- callback.Run(web_contents_map_[guest_instance_id].web_contents);
+ return web_contents_map_[guest_instance_id].web_contents;
else
- callback.Run(nullptr);
+ return nullptr;
}
bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
#include <map>
#include "content/public/browser/browser_plugin_guest_manager.h"
+#include "url/gurl.h"
namespace content {
class BrowserContext;
protected:
// content::BrowserPluginGuestManager:
- virtual void MaybeGetGuestByInstanceIDOrKill(
- int guest_instance_id,
- int embedder_render_process_id,
- const GuestByInstanceIDCallback& callback) override;
- virtual bool ForEachGuest(content::WebContents* embedder_web_contents,
- const GuestCallback& callback) override;
+ content::WebContents* GetGuestByInstanceID(
+ content::WebContents* embedder_web_contents,
+ int browser_plugin_instance_id) override;
+ bool ForEachGuest(content::WebContents* embedder_web_contents,
+ const GuestCallback& callback) override;
private:
struct WebContentsWithEmbedder {
}
void WriteText(const base::string16& text, ui::ClipboardType type) {
- ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
- ui::ScopedClipboardWriter writer(clipboard, type);
+ ui::ScopedClipboardWriter writer(type);
writer.WriteText(text);
}