Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/renderer/pepper/pepper_extensions_common_host.cc

Issue 240603003: Remove ChromeV8Extension & most of ChromeV8Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/pepper/pepper_extensions_common_host.h" 5 #include "chrome/renderer/pepper/pepper_extensions_common_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/renderer/extensions/chrome_v8_context.h" 10 #include "chrome/renderer/extensions/chrome_v8_context.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (!dispatcher) 56 if (!dispatcher)
57 return NULL; 57 return NULL;
58 blink::WebPluginContainer* container = 58 blink::WebPluginContainer* container =
59 host->GetContainerForInstance(instance); 59 host->GetContainerForInstance(instance);
60 if (!container) 60 if (!container)
61 return NULL; 61 return NULL;
62 blink::WebFrame* frame = container->element().document().frame(); 62 blink::WebFrame* frame = container->element().document().frame();
63 if (!frame) 63 if (!frame)
64 return NULL; 64 return NULL;
65 v8::HandleScope scope(v8::Isolate::GetCurrent()); 65 v8::HandleScope scope(v8::Isolate::GetCurrent());
66 // TODO(rockot): Remove this downcast. See http://crbug.com/362616.
66 extensions::ChromeV8Context* context = 67 extensions::ChromeV8Context* context =
67 dispatcher->v8_context_set().GetByV8Context( 68 static_cast<extensions::ChromeV8Context*>(
68 frame->mainWorldScriptContext()); 69 dispatcher->script_context_set().GetByV8Context(
70 frame->mainWorldScriptContext()));
69 if (!context) 71 if (!context)
70 return NULL; 72 return NULL;
71 73
72 return new PepperExtensionsCommonHost( 74 return new PepperExtensionsCommonHost(
73 host, instance, resource, context->pepper_request_proxy()); 75 host, instance, resource, context->pepper_request_proxy());
74 } 76 }
75 77
76 int32_t PepperExtensionsCommonHost::OnResourceMessageReceived( 78 int32_t PepperExtensionsCommonHost::OnResourceMessageReceived(
77 const IPC::Message& msg, 79 const IPC::Message& msg,
78 ppapi::host::HostMessageContext* context) { 80 ppapi::host::HostMessageContext* context) {
(...skipping 30 matching lines...) Expand all
109 std::string error; 111 std::string error;
110 bool success = pepper_request_proxy_->StartRequest( 112 bool success = pepper_request_proxy_->StartRequest(
111 base::Bind(&PepperExtensionsCommonHost::OnResponseReceived, 113 base::Bind(&PepperExtensionsCommonHost::OnResponseReceived,
112 weak_factory_.GetWeakPtr(), 114 weak_factory_.GetWeakPtr(),
113 context->MakeReplyMessageContext()), 115 context->MakeReplyMessageContext()),
114 request_name, 116 request_name,
115 args, 117 args,
116 &error); 118 &error);
117 return success ? PP_OK_COMPLETIONPENDING : PP_ERROR_FAILED; 119 return success ? PP_OK_COMPLETIONPENDING : PP_ERROR_FAILED;
118 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698