| OLD | NEW |
| 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/app_runtime_custom_bindings.h" | 5 #include "chrome/renderer/extensions/app_runtime_custom_bindings.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" | 8 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlob.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlob.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DCHECK(base::StringToInt64(blob_length_string, &blob_length)); | 48 DCHECK(base::StringToInt64(blob_length_string, &blob_length)); |
| 49 WebKit::WebBlob web_blob = WebBlob::createFromFile( | 49 WebKit::WebBlob web_blob = WebBlob::createFromFile( |
| 50 WebString::fromUTF8(blob_file_path), blob_length); | 50 WebString::fromUTF8(blob_file_path), blob_length); |
| 51 return web_blob.toV8Value(); | 51 return web_blob.toV8Value(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 namespace extensions { | 56 namespace extensions { |
| 57 | 57 |
| 58 AppRuntimeCustomBindings::AppRuntimeCustomBindings( | 58 AppRuntimeCustomBindings::AppRuntimeCustomBindings() |
| 59 Dispatcher* dispatcher, | 59 : ChromeV8Extension(NULL) { |
| 60 v8::Handle<v8::Context> context) : ChromeV8Extension(dispatcher, context) { | |
| 61 RouteStaticFunction("DeserializeString", &DeserializeString); | 60 RouteStaticFunction("DeserializeString", &DeserializeString); |
| 62 RouteStaticFunction("SerializeToString", &SerializeToString); | 61 RouteStaticFunction("SerializeToString", &SerializeToString); |
| 63 RouteStaticFunction("CreateBlob", &CreateBlob); | 62 RouteStaticFunction("CreateBlob", &CreateBlob); |
| 64 } | 63 } |
| 65 | 64 |
| 66 } // namespace extensions | 65 } // namespace extensions |
| OLD | NEW |