Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 geolocation_dispatcher_(NULL), | 668 geolocation_dispatcher_(NULL), |
| 669 push_messaging_dispatcher_(NULL), | 669 push_messaging_dispatcher_(NULL), |
| 670 presentation_dispatcher_(NULL), | 670 presentation_dispatcher_(NULL), |
| 671 screen_orientation_dispatcher_(NULL), | 671 screen_orientation_dispatcher_(NULL), |
| 672 manifest_manager_(NULL), | 672 manifest_manager_(NULL), |
| 673 accessibility_mode_(AccessibilityModeOff), | 673 accessibility_mode_(AccessibilityModeOff), |
| 674 renderer_accessibility_(NULL), | 674 renderer_accessibility_(NULL), |
| 675 weak_factory_(this) { | 675 weak_factory_(this) { |
| 676 std::pair<RoutingIDFrameMap::iterator, bool> result = | 676 std::pair<RoutingIDFrameMap::iterator, bool> result = |
| 677 g_routing_id_frame_map.Get().insert(std::make_pair(routing_id_, this)); | 677 g_routing_id_frame_map.Get().insert(std::make_pair(routing_id_, this)); |
| 678 CHECK(result.second) << "Inserting a duplicate item."; | 678 if (!result.second) { |
| 679 // TODO(lfg): Temporary. We're about to force a crash, so save the debug | |
| 680 // info on the stack so we can recover it from the crash dumps. | |
| 681 RenderFrameImpl* duplicate = result.first->second; | |
| 682 const std::vector<unsigned long>& debug_info = render_view->debug_info(); | |
| 683 const std::vector<unsigned long>& duplicate_debug_info = | |
| 684 duplicate->render_view()->debug_info(); | |
| 685 unsigned long duplicate_stack_debug_info[128]; | |
| 686 unsigned long stack_debug_info[128]; | |
| 687 const int size = debug_info.size() > 128 ? 128 : debug_info.size(); | |
| 688 const int duplicate_size = | |
| 689 duplicate_debug_info.size() > 128 ? 128 : duplicate_debug_info.size(); | |
| 690 memcpy(&stack_debug_info, &debug_info[0], size * sizeof(unsigned long)); | |
|
nasko
2015/03/16 18:38:26
memcpy from the memory of a stl container sounds s
| |
| 691 memcpy(&duplicate_stack_debug_info, &duplicate_debug_info[0], | |
| 692 duplicate_size * sizeof(unsigned long)); | |
| 693 CHECK(result.second) << "Inserting a duplicate item."; | |
| 694 } | |
| 679 | 695 |
| 680 RenderThread::Get()->AddRoute(routing_id_, this); | 696 RenderThread::Get()->AddRoute(routing_id_, this); |
| 681 | 697 |
| 682 render_view_->RegisterRenderFrame(this); | 698 render_view_->RegisterRenderFrame(this); |
| 683 | 699 |
| 684 // Everything below subclasses RenderFrameObserver and is automatically | 700 // Everything below subclasses RenderFrameObserver and is automatically |
| 685 // deleted when the RenderFrame gets deleted. | 701 // deleted when the RenderFrame gets deleted. |
| 686 #if defined(OS_ANDROID) | 702 #if defined(OS_ANDROID) |
| 687 new GinJavaBridgeDispatcher(this); | 703 new GinJavaBridgeDispatcher(this); |
| 688 #endif | 704 #endif |
| (...skipping 3826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4515 | 4531 |
| 4516 #if defined(ENABLE_BROWSER_CDMS) | 4532 #if defined(ENABLE_BROWSER_CDMS) |
| 4517 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4533 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4518 if (!cdm_manager_) | 4534 if (!cdm_manager_) |
| 4519 cdm_manager_ = new RendererCdmManager(this); | 4535 cdm_manager_ = new RendererCdmManager(this); |
| 4520 return cdm_manager_; | 4536 return cdm_manager_; |
| 4521 } | 4537 } |
| 4522 #endif // defined(ENABLE_BROWSER_CDMS) | 4538 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4523 | 4539 |
| 4524 } // namespace content | 4540 } // namespace content |
| OLD | NEW |