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

Side by Side Diff: chrome/renderer/extensions/page_capture_custom_bindings.cc

Issue 311263005: Should provide creation context and isolate for WebBlob::toV8Value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | extensions/renderer/app_runtime_custom_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/page_capture_custom_bindings.h" 5 #include "chrome/renderer/extensions/page_capture_custom_bindings.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "extensions/common/extension_messages.h" 10 #include "extensions/common/extension_messages.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 void PageCaptureCustomBindings::CreateBlob( 27 void PageCaptureCustomBindings::CreateBlob(
28 const v8::FunctionCallbackInfo<v8::Value>& args) { 28 const v8::FunctionCallbackInfo<v8::Value>& args) {
29 CHECK(args.Length() == 2); 29 CHECK(args.Length() == 2);
30 CHECK(args[0]->IsString()); 30 CHECK(args[0]->IsString());
31 CHECK(args[1]->IsInt32()); 31 CHECK(args[1]->IsInt32());
32 blink::WebString path(base::UTF8ToUTF16(*v8::String::Utf8Value(args[0]))); 32 blink::WebString path(base::UTF8ToUTF16(*v8::String::Utf8Value(args[0])));
33 blink::WebBlob blob = 33 blink::WebBlob blob =
34 blink::WebBlob::createFromFile(path, args[1]->Int32Value()); 34 blink::WebBlob::createFromFile(path, args[1]->Int32Value());
35 args.GetReturnValue().Set(blob.toV8Value()); 35 args.GetReturnValue().Set(blob.toV8Value(args.Holder(), args.GetIsolate()));
36 } 36 }
37 37
38 void PageCaptureCustomBindings::SendResponseAck( 38 void PageCaptureCustomBindings::SendResponseAck(
39 const v8::FunctionCallbackInfo<v8::Value>& args) { 39 const v8::FunctionCallbackInfo<v8::Value>& args) {
40 CHECK(args.Length() == 1); 40 CHECK(args.Length() == 1);
41 CHECK(args[0]->IsInt32()); 41 CHECK(args[0]->IsInt32());
42 42
43 content::RenderView* render_view = context()->GetRenderView(); 43 content::RenderView* render_view = context()->GetRenderView();
44 if (render_view) { 44 if (render_view) {
45 render_view->Send(new ExtensionHostMsg_ResponseAck( 45 render_view->Send(new ExtensionHostMsg_ResponseAck(
46 render_view->GetRoutingID(), args[0]->Int32Value())); 46 render_view->GetRoutingID(), args[0]->Int32Value()));
47 } 47 }
48 } 48 }
49 49
50 } // namespace extensions 50 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/app_runtime_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698