| Index: extensions/renderer/send_request_natives.cc
|
| diff --git a/extensions/renderer/send_request_natives.cc b/extensions/renderer/send_request_natives.cc
|
| index 2f9d2f5c08a74a0363c40e56221b1438abdcda3e..c27b533278ac3427f7db8bc17ca51d9bc8d67542 100644
|
| --- a/extensions/renderer/send_request_natives.cc
|
| +++ b/extensions/renderer/send_request_natives.cc
|
| @@ -7,6 +7,8 @@
|
| #include <stdint.h>
|
|
|
| #include "base/json/json_reader.h"
|
| +#include "base/metrics/histogram_macros.h"
|
| +#include "base/timer/elapsed_timer.h"
|
| #include "content/public/child/v8_value_converter.h"
|
| #include "extensions/renderer/request_sender.h"
|
| #include "extensions/renderer/script_context.h"
|
| @@ -30,6 +32,7 @@ SendRequestNatives::SendRequestNatives(RequestSender* request_sender,
|
| // callback will be dispatched to EventBindings::HandleResponse.
|
| void SendRequestNatives::StartRequest(
|
| const v8::FunctionCallbackInfo<v8::Value>& args) {
|
| + base::ElapsedTimer timer;
|
| CHECK_EQ(5, args.Length());
|
| std::string name = *v8::String::Utf8Value(args[0]);
|
| bool has_callback = args[2]->BooleanValue();
|
| @@ -55,13 +58,18 @@ void SendRequestNatives::StartRequest(
|
| return;
|
| }
|
|
|
| - request_sender_->StartRequest(
|
| - context(),
|
| - name,
|
| - request_id,
|
| - has_callback,
|
| - for_io_thread,
|
| - static_cast<base::ListValue*>(value_args.get()));
|
| + if (request_sender_->StartRequest(
|
| + context(),
|
| + name,
|
| + request_id,
|
| + has_callback,
|
| + for_io_thread,
|
| + static_cast<base::ListValue*>(value_args.get()))) {
|
| + // TODO(devlin): Would it be useful to partition this data based on
|
| + // extension function once we have a suitable baseline? crbug.com/608561.
|
| + UMA_HISTOGRAM_TIMES("Extensions.Functions.StartRequestElapsedTime",
|
| + timer.Elapsed());
|
| + }
|
| }
|
|
|
| void SendRequestNatives::GetGlobal(
|
|
|