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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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) 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/chrome_private_custom_bindings.h" 5 #include "chrome/renderer/extensions/chrome_private_custom_bindings.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Note(mnaganov): to speed this up, you may use backing store 93 // Note(mnaganov): to speed this up, you may use backing store
94 // technique from CreateExternalArray() of v8/src/d8.cc. 94 // technique from CreateExternalArray() of v8/src/d8.cc.
95 v8::Local<v8::Array> bitmap_array(v8::Array::New(width * height)); 95 v8::Local<v8::Array> bitmap_array(v8::Array::New(width * height));
96 for (int i = 0; i != width * height; ++i) { 96 for (int i = 0; i != width * height; ++i) {
97 bitmap_array->Set(v8::Integer::New(i), 97 bitmap_array->Set(v8::Integer::New(i),
98 v8::Integer::New(pixels[i] & 0xFFFFFF)); 98 v8::Integer::New(pixels[i] & 0xFFFFFF));
99 } 99 }
100 return bitmap_array; 100 return bitmap_array;
101 } 101 }
102 102
103 v8::Handle<v8::FunctionTemplate> ChromePrivateCustomBindings::GetNativeFunction( 103 void ChromePrivateCustomBindings::SetNativeFunctions(
104 v8::Handle<v8::String> name) { 104 v8::Handle<v8::Object> object) {
105 if (name->Equals(v8::String::New("DecodeJPEG"))) 105 RouteFunctionToStatic("DecodeJPEG", DecodeJPEG, object);
106 return v8::FunctionTemplate::New(DecodeJPEG, v8::External::New(this));
107
108 return ChromeV8Extension::GetNativeFunction(name);
109 } 106 }
110 107
111 } // namespace extensions 108 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698