| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/activity_log_converter_strategy.h" | 5 #include "extensions/renderer/activity_log_converter_strategy.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 ActivityLogConverterStrategy::ActivityLogConverterStrategy() {} | 52 ActivityLogConverterStrategy::ActivityLogConverterStrategy() {} |
| 53 | 53 |
| 54 ActivityLogConverterStrategy::~ActivityLogConverterStrategy() {} | 54 ActivityLogConverterStrategy::~ActivityLogConverterStrategy() {} |
| 55 | 55 |
| 56 bool ActivityLogConverterStrategy::FromV8Object( | 56 bool ActivityLogConverterStrategy::FromV8Object( |
| 57 v8::Local<v8::Object> value, | 57 v8::Local<v8::Object> value, |
| 58 base::Value** out, | 58 std::unique_ptr<base::Value>* out, |
| 59 v8::Isolate* isolate, | 59 v8::Isolate* isolate, |
| 60 const FromV8ValueCallback& callback) const { | 60 const FromV8ValueCallback& callback) const { |
| 61 return FromV8Internal(value, out, isolate, callback); | 61 return FromV8Internal(value, out, isolate, callback); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool ActivityLogConverterStrategy::FromV8Array( | 64 bool ActivityLogConverterStrategy::FromV8Array( |
| 65 v8::Local<v8::Array> value, | 65 v8::Local<v8::Array> value, |
| 66 base::Value** out, | 66 std::unique_ptr<base::Value>* out, |
| 67 v8::Isolate* isolate, | 67 v8::Isolate* isolate, |
| 68 const FromV8ValueCallback& callback) const { | 68 const FromV8ValueCallback& callback) const { |
| 69 return FromV8Internal(value, out, isolate, callback); | 69 return FromV8Internal(value, out, isolate, callback); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool ActivityLogConverterStrategy::FromV8Internal( | 72 bool ActivityLogConverterStrategy::FromV8Internal( |
| 73 v8::Local<v8::Object> value, | 73 v8::Local<v8::Object> value, |
| 74 base::Value** out, | 74 std::unique_ptr<base::Value>* out, |
| 75 v8::Isolate* isolate, | 75 v8::Isolate* isolate, |
| 76 const FromV8ValueCallback& callback) const { | 76 const FromV8ValueCallback& callback) const { |
| 77 std::unique_ptr<base::Value> parsed_value; | 77 *out = SummarizeV8Value(isolate, value); |
| 78 parsed_value = SummarizeV8Value(isolate, value); | |
| 79 *out = parsed_value.release(); | |
| 80 | 78 |
| 81 return true; | 79 return true; |
| 82 } | 80 } |
| 83 | 81 |
| 84 } // namespace extensions | 82 } // namespace extensions |
| OLD | NEW |