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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11360042: Encrypted Media: Add TRACE_EVENT to trace eme implementation performance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use uint32 for the trace_id_ Created 8 years, 1 month 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 | « webkit/media/crypto/ppapi/clear_key_cdm.cc ('k') | no next file » | 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 ScopedPPResource encrypted_resource( 1913 ScopedPPResource encrypted_resource(
1914 ScopedPPResource::PassRef(), 1914 ScopedPPResource::PassRef(),
1915 MakeBufferResource(pp_instance(), 1915 MakeBufferResource(pp_instance(),
1916 encrypted_buffer->GetData(), 1916 encrypted_buffer->GetData(),
1917 encrypted_buffer->GetDataSize())); 1917 encrypted_buffer->GetDataSize()));
1918 if (!encrypted_buffer->IsEndOfStream() && !encrypted_resource.get()) 1918 if (!encrypted_buffer->IsEndOfStream() && !encrypted_resource.get())
1919 return false; 1919 return false;
1920 1920
1921 const uint32_t request_id = next_decryption_request_id_++; 1921 const uint32_t request_id = next_decryption_request_id_++;
1922 DVLOG(2) << "DecryptAndDecodeVideo() - request_id " << request_id; 1922 DVLOG(2) << "DecryptAndDecodeVideo() - request_id " << request_id;
1923 TRACE_EVENT_ASYNC_BEGIN0(
1924 "eme", "PluginInstance::DecryptAndDecodeVideo", request_id);
1923 1925
1924 PP_EncryptedBlockInfo block_info; 1926 PP_EncryptedBlockInfo block_info;
1925 if (!MakeEncryptedBlockInfo( 1927 if (!MakeEncryptedBlockInfo(
1926 encrypted_buffer->GetDecryptConfig(), 1928 encrypted_buffer->GetDecryptConfig(),
1927 encrypted_buffer->GetTimestamp().InMicroseconds(), 1929 encrypted_buffer->GetTimestamp().InMicroseconds(),
1928 request_id, 1930 request_id,
1929 &block_info)) { 1931 &block_info)) {
1930 return false; 1932 return false;
1931 } 1933 }
1932 1934
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 DCHECK(frame_info); 2747 DCHECK(frame_info);
2746 const uint32_t request_id = frame_info->tracking_info.request_id; 2748 const uint32_t request_id = frame_info->tracking_info.request_id;
2747 DVLOG(2) << "DeliverFrame() - request_id: " << request_id; 2749 DVLOG(2) << "DeliverFrame() - request_id: " << request_id;
2748 2750
2749 // If the request ID is not valid or does not match what's saved, do nothing. 2751 // If the request ID is not valid or does not match what's saved, do nothing.
2750 if (request_id == 0 || request_id != pending_video_decode_request_id_) { 2752 if (request_id == 0 || request_id != pending_video_decode_request_id_) {
2751 DVLOG(1) << "DeliverFrame() - request_id " << request_id << " not found"; 2753 DVLOG(1) << "DeliverFrame() - request_id " << request_id << " not found";
2752 return; 2754 return;
2753 } 2755 }
2754 2756
2757 TRACE_EVENT_ASYNC_END0(
2758 "eme", "PluginInstance::DecryptAndDecodeVideo", request_id);
2759
2755 DCHECK(!pending_video_decode_cb_.is_null()); 2760 DCHECK(!pending_video_decode_cb_.is_null());
2756 pending_video_decode_request_id_ = 0; 2761 pending_video_decode_request_id_ = 0;
2757 media::Decryptor::VideoDecodeCB video_decode_cb = 2762 media::Decryptor::VideoDecodeCB video_decode_cb =
2758 base::ResetAndReturn(&pending_video_decode_cb_); 2763 base::ResetAndReturn(&pending_video_decode_cb_);
2759 2764
2760 media::Decryptor::Status status = 2765 media::Decryptor::Status status =
2761 PpDecryptResultToMediaDecryptorStatus(frame_info->result); 2766 PpDecryptResultToMediaDecryptorStatus(frame_info->result);
2762 if (status != media::Decryptor::kSuccess) { 2767 if (status != media::Decryptor::kSuccess) {
2763 video_decode_cb.Run(status, NULL); 2768 video_decode_cb.Run(status, NULL);
2764 return; 2769 return;
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
3227 screen_size_for_fullscreen_ = gfx::Size(); 3232 screen_size_for_fullscreen_ = gfx::Size();
3228 WebElement element = container_->element(); 3233 WebElement element = container_->element();
3229 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 3234 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
3230 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 3235 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
3231 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 3236 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
3232 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 3237 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
3233 } 3238 }
3234 3239
3235 } // namespace ppapi 3240 } // namespace ppapi
3236 } // namespace webkit 3241 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/media/crypto/ppapi/clear_key_cdm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698